# encoding=utf-8
from flask import Blueprint, request

from app.Bean.ResultData import ResultData
from app.Models.Team import Team
import pandas as pd

from app.Service.TeamService import TeamService

team = Blueprint('team', __name__)
team_service = TeamService()


@team.route('/team/team_list', methods=['GET'])
def team_list():
    return ResultData().sucess(team_service.get_team_list())

@team.route('/team/history', methods=['GET'])
def history():
    team_name = request.args.get('team_name')
    return ResultData().sucess(team_service.get_team_history(team_name))


@team.route('/team/player_salary', methods=['GET'])
def player_salary():
    team_name = request.args.get('team_name')
    return ResultData().sucess(team_service.get_team_player_salary(team_name))
